
// TODO Range is not supported yet, as I do not know how to standardize range

#ifndef MPSREADER_HPP
#define MPSREADER_HPP

#include <string>
#include <vector>

#include <coin/CoinMpsIO.hpp>

#include <Eigen/Sparse>

namespace green {

// Wrapper for CoinUtils MPS Parser
class MPSReader {

 public:

  enum class RowSense : char {
    LESS_THAN, GREATER_THAN, EQUAL_TO
  };
  // Given file is parsed using CoinMpsIO
  // Runtime_Error exception is thrown if
  //   File does not exist
  //   File cannot be parsed
  MPSReader(const std::string absoluteFilePath);

  std::string getProblemName() const;

  std::string getObjectiveName() const;

  std::string getRHSName() const;

  std::string getRangeName() const;

  std::string getBoundName() const;

  int getNumberOfRows() const;

  int getNumberOfColumns() const;

  int getNumberOfElements() const;

  std::vector<double> getColumnLowerBounds() const;

  std::vector<double> getColumnUpperBounds() const;

  Eigen::SparseVector<double> getObjectiveCoefficients() const;

  Eigen::SparseMatrix<double> getConstraints() const;

  Eigen::SparseVector<double> getRHS() const;

  std::vector<RowSense> getRowSense() const;

 protected:

 private:
  CoinMpsIO coinReader{};

  // No Copy allowed
  // TODO May be I will add if usecase demands
  MPSReader(const MPSReader&) = delete;
  MPSReader& operator=(const MPSReader&) = delete;
};
}

#endif  // MPSREADER_HPP
